package main;
import enums.Sex;


public abstract class Person
{
	private String firstName;
	private String lastName;
	private Sex sex;
	private PersonalInfo personalInfo;
	private int id;
    private static int idCounter = 0;
    
    public Person(String firstName, String lastName, Sex sex){
    	this.firstName = firstName;
    	this.lastName = lastName;
    	this.setSex(sex);
    	id = ++idCounter;
    }	
    public Person(){
    	id = ++idCounter;
    }
	public void setPersonsFirstName(String firstName){
		this.firstName = firstName;
	}
	public void setPersonsLastName(String lastName){
		this.lastName = lastName;
	}
	public String getPersonsFirstName(){
		return firstName;
	}
	public String getPersonsLastName(){
		return lastName;
	}	
	public int getID() {
        return id;
    }
	/*returns a new instance of PersonalInfo object
	 * 
	 */
	public PersonalInfo _PersonalInfo(){
		if (this.personalInfo == null) {
			this.personalInfo =  new PersonalInfo();
			}
		return this.personalInfo;
	}
	public Sex _Sex() {
		if(this.sex == null){
			this.sex = Sex.MALE;
		}		
		return this.sex;
	}
	public void setSex(Sex sex) {
		this.sex = sex;
	}
}